Hi, I have a dataset which has a variable mother_no that stores the number that represents mother in the household roster. Another set of variables h12_1, h12_2, h12_3......etc represent the age of the household member 1, 2 and 3 respectively. I want to now create a variable mother_age that stores the mother's age.
The above table shows an example. For the first row, since mother_no takes a value 3, mother_age stores the value of h12_3.
How do I create the variable mother_age for my data. Thanks.
mother_no | h12_1 | h12_2 | h12_3 | h12_4 | h12_5 | mother_age |
3 | 23 | 34 | 23 | 54 | 56 | 23 |
1 | 24 | 54 | 43 | 76 | 23 | 24 |
3 | 54 | 73 | 35 | 38 | 49 | 73 |
4 | 12 | 13 | 46 | 37 | 42 | 37 |
5 | 52 | 73 | 74 | 24 | 14 | 14 |
The above table shows an example. For the first row, since mother_no takes a value 3, mother_age stores the value of h12_3.
How do I create the variable mother_age for my data. Thanks.
Comment